//
//  Terms.m
//  KurtulusLaw
//
//  Created by phuc phuc on 12/2/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "Terms.h"
#import "Constant.h"
#import "RTLabel.h"
@implementation Terms
@synthesize scrollView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle
-(void)back : (id) sender
{
    [self dismissModalViewControllerAnimated:YES];
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = NSLocalizedString(@"Terms and Conditions", nil);
    UIButton *btnBack = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 41, 46)];
    btnBack.tintColor = [UIColor blackColor];
    [btnBack setImage:[UIImage imageNamed:kImageSetting34x46] forState:UIControlStateNormal];
    [btnBack setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
    [btnBack addTarget:self action:@selector(back:) forControlEvents:UIControlEventTouchDown];
    [self.navigationController.navigationBar addSubview:btnBack];
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav-bg-black"] forBarMetrics:UIBarMetricsDefault] ;
	
	NSString *text = NSLocalizedString(@"Term And Conditions Content", nil);
	
	RTLabel *rtLabel = [[RTLabel alloc] initWithFrame:CGRectMake(10, 5, 300, 60)];
	[rtLabel setText:text];
	CGRect frame = [rtLabel frame];
	frame.size = [rtLabel optimumSize];
	[rtLabel setFrame:frame];
	
	[self.scrollView setContentSize:CGSizeMake(320, frame.size.height + 10)];
	[self.scrollView addSubview:rtLabel];
}

- (void)viewDidUnload
{
    [self setScrollView:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
